Skip to content

feat(server)!: implement recursive control condition trees#115

Open
lan17 wants to merge 20 commits intomainfrom
codex/feature/sc-58429-condition-trees
Open

feat(server)!: implement recursive control condition trees#115
lan17 wants to merge 20 commits intomainfrom
codex/feature/sc-58429-condition-trees

Conversation

@lan17
Copy link
Contributor

@lan17 lan17 commented Mar 12, 2026

corresponding docs update: agentcontrol/docs-agent-control#28

Summary

  • replace flat control predicates with recursive condition trees across the shared models, engine, server, SDKs, and UI
  • add pre-upgrade control migration tooling plus safe condition_trace metadata for composite evaluation
  • bump package majors and regenerate the TypeScript SDK/API types for the new contract

Scope

  • User-facing/API changes:
    • ControlDefinition now uses a top-level condition tree instead of top-level selector / evaluator
    • controls now support nested and / or / not composition with a hard API depth limit of 6
    • /api/v1 stays the same, but this is a major-version wire break and old SDK majors are unsupported against the new server
    • added make server-migrate-control-conditions MIGRATE_ARGS=--dry-run and make server-migrate-control-conditions MIGRATE_ARGS=--apply
  • Internal changes:
    • recursive engine evaluation with short-circuiting and metadata.condition_trace
    • recursive server-side validation with nested field paths
    • Python SDK recursive leaf checks plus non-blocking server-version mismatch warnings
    • UI condition-tree builder with add/remove/convert/reorder actions and nested error rendering
  • Out of scope:
    • runtime backward-compatibility shims for legacy flat control payloads
    • drag-and-drop tree editing

Risk and Rollout

  • Risk level: high
  • Rollback plan:
    • take a database backup before running the migration apply step
    • if rollout fails before migration, revert to the previous server/SDK major
    • if rollout fails after migration, restore the pre-migration database snapshot before rolling back the server major

Testing

  • Added or updated automated tests
  • Ran make check
  • Manually verified behavior

make check passed, which covered:

  • make server-test
  • make engine-test
  • make sdk-test
  • make evaluators-test
  • repo linting
  • repo typechecking

Notes:

  • the run emitted a few existing third-party warnings (sqlglot[rs] deprecation, Strands resource/deprecation warnings), but the full target passed cleanly

Checklist

  • Linked issue/spec: sc-57582, sc-58429
  • Updated docs/examples for user-facing changes
  • Included any required follow-up tasks

lan17 added 2 commits March 11, 2026 22:03
…9-condition-trees

# Conflicts:
#	ui/src/core/page-components/agent-detail/modals/edit-control/edit-control-content.tsx
@lan17 lan17 changed the title feat!: implement recursive control condition trees feat(server)!: implement recursive control condition trees Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 12, 2026

@lan17 lan17 marked this pull request as ready for review March 12, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant